<?php
class Backend_Form_Search extends Zend_Form {

    public $elementDecorators = array('ViewHelper', 'Errors', 'Label');


	public function init() {

		// Übersetzen der Meldungen
		//$translate = new Zend_Translate('array', 'formMessages.php', 'de');
        //Zend_Validate_Abstract::setDefaultTranslator($translate);

        $this->setAction(Zend_Controller_Front::getInstance()->getBaseUrl());
		$this->setMethod('post');

		//Sprachen
        $translate       = Zend_Registry::get('Zend_Translate');
        $currentLanguage = Zend_Registry::get('Zend_Locale')->getLanguage();

		$form[0] = new Zend_Form_Element_Text('searchword');
		$form[0]->setAttrib('class','btn_grey_big')
                ->setDecorators($this->elementDecorators);

		// Speichern Button
		$form[1] = new Zend_Form_Element_Submit('searchfull');
		$form[1]->setLabel(strtolower($translate->translate('formSuchen', $currentLanguage)));
		$form[1]->setAttrib('class','submit')
                ->setDecorators( array('ViewHelper', 'Errors'));

		$this->addElements($form);

		//Decerator Skript laden
		//$this->setDecorators( array( array('ViewScript', array('viewScript' => 'index/index.phtml'))));

	}

}
?>